package com.zzj.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzj.entity.Admin;
import com.zzj.mapper.AdminMapper;
import com.zzj.service.IAdminService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zzj
 * @since 2023-05-12
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {

    @Override
    public Admin getAdminById(int id) {
        return this.getOne(Wrappers.<Admin>lambdaQuery()
                        .eq(Admin::getId, id),
                false);
    }

    @Override
    public Admin getAdminByUsername(String username) {
        return this.getOne(Wrappers.<Admin>lambdaQuery()
                        .eq(Admin::getUsername, username),
                false);
    }
}
